<%@page import="com.windfone.common.Constant"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ include file="head.jsp"%>
<%@ taglib uri="/WEB-INF/recommend.tld" prefix="windfone"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>风驰电讯  您最贴心的手机顾问  用户登录或注册</title>
<link href="css/css.css" rel="stylesheet" type="text/css" />
<%@ include file="headkey.jsp"%>
<script>
	function changePostType(type) {
		var totalMoney = document.getElementById("totalMoney");
		var textnode = totalMoney.firstChild;
		var content = textnode.nodeValue;
		var strMoney = content.substring(1, content.length);
		var allMoeny = document.getElementById("allMoeny");
		var total = 0;
		total = total + parseFloat(strMoney);
		var postMoney = document.getElementById("postMoney");
		if (type == "1") {
			postMoney.innerHTML = "￥40.00";
			allMoeny.innerHTML = "￥" + (total + 40);
		} else {
			postMoney.innerHTML = "￥0.00";
			allMoeny.innerHTML = "￥" + total;
		}
	}
	function submitOrder() {
		var tel1 = document.getElementById("tel1");
		var tel2 = document.getElementById("tel2");
		var tel3 = document.getElementById("tel3");
		var orderForm = document.getElementById("orderForm");
		var telnumber = document.getElementById("telnumber");
		telnumber.value = tel1.value + "-" + tel2.value + "-" + tel3.value;
		var name = document.getElementById("name");
		var email = document.getElementById("email");
		var mobile = document.getElementById("mobile");
		var zipcode = document.getElementById("zipcode");
		var detailaddress = document.getElementById("detailaddress");
		if (name.value == "") {
			alert("名字不能为空");
			name.focus();
			return false;
		}
		if (email.value == "") {
			alert("邮件不能为空");
			email.focus();
			return false;
		}
		if (mobile.value == "") {
			alert(" 联系手机不能为空");
			mobile.focus();
			return false;
		}
		if (zipcode.value == "") {
			alert("邮政编码不能为空");
			zipcode.focus();
			return false;
		}
		if (detailaddress.value == "") {
			alert("详细地址不能为空");
			detailaddress.focus();
			return false;
		}
		orderForm.submit();
	}
</script>
</head>

<body id="pages9">

<!--头部-->
<%@ include file="navigate.jsp"%>
<!--内容-->
<div class="contentBox"><!--左区-->
<div class="col2" style="width: 990px">
<div class="tabLeBoxB" style="padding-top: 0">
<div class="title">
<h3>购物车</h3>
</div>
<form name="orderForm" method="post" action="orderShow.action" id="orderForm">
<div class="borderBox">
<div><img src="images/sopping3.gif" width="934" height="81" /></div>
<div class="title_1">收货人信息</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0"	class="tableStyle">
	<tr>
		<td width="150"><span style="color: #F00">*</span> 收货人姓名</td>
		<td style="text-align: left"><input type="text"	style="width: 30%;" id="name" maxlength="50" name="name"/></td>
	</tr>
	<tr>
		<td><span style="color: #F00">*</span> 电子邮箱</td>
		<td style="text-align: left"><input type="text"	style="width: 30%;" id="email" maxlength="100" value="" name="email"/></td>
	</tr>
	<tr>
		<td>联系电话</td>
		<td style="text-align: left">
			<input type="text"	style="width: 50px;" id="tel1" maxlength="50" name="tel1"/>&nbsp;-&nbsp;
			<input type="text" style="width: 50px;" id="tel2" maxlength="50" name="tel2"/>&nbsp;-&nbsp;
			<input type="text" style="width: 50px;" id="tel3" maxlength="50" name="tel3"/>格式:
		区号-固定电话号码-分机号码</td>
	</tr>
	<tr>
		<td><span style="color: #F00">*</span> 联系手机</td>
		<td style="text-align: left">
			<input type="text" style="width: 30%;" id="mobile" maxlength="50" name="mobile" />
		</td>
	</tr>
	<tr>
		<td><span style="color: #F00">*</span> 邮政编码</td>
		<td style="text-align: left">
			<input type="text" style="width: 30%;" id="zipcode" maxlength="50" name="zipcode" />
		</td>
	</tr>
	<tr>
		<td><span style="color: #F00">*</span> 详细地址</td>
		<td style="text-align: left">
			<input type="text" style="width: 30%;" id="detailaddress" maxlength="50" name="detailaddress" />
		</td>
	</tr>
	<tr>
		<td>备注</td>
		<td style="text-align: left">
			<textarea name="memo" cols="50" rows="5" id="memo"></textarea>
		</td>
	</tr>
</table>
<div class="title_1">选择配送方式</div>
<table class="t1">
	<tbody>
		<tr>
			<th>名称</th>
			<th>描述</th>
			<th>收费方式</th>
		</tr>
		<tr>
			<td>
				<input type="radio" onclick="changePostType('1');"   value="1" id="rbtnPost1" name="rbtnPost"/>
				<label style="margin-left: 5px;" for="rbtnPost1">
					<span style="color: red; font-weight: bold;">EMS 快递</span> 
				</label>
			</td>
			<td>建议三级以下城市和顺丰不支持的地区选择</td>
			<td><span style="color: green; font-weight: bold;">40.00元</span></td>
		</tr>
		<tr>
			<td>
				<input type="radio" onclick="changePostType('2');" checked="checked"  value="2" id="rbtnPost2" name="rbtnPost"/> 
				<label style="margin-left: 5px;" for="rbtnPost2"> 
					<span style="color: red; font-weight: bold;">顺丰快递</span> 
				</label>
			</td>
			<td>顺丰支持邮费到付，可收到货物后再自行支付邮费</td>
			<td><span style="color: green; font-weight: bold;">无</span></td>
		</tr>
	</tbody>
</table>
<div class="title_1">选择支付方式</div>
<div style="display: block;" id="paytype4">
<dl class="payitem">
	<dd class="radio">
		<input type="radio" value="1" id="rbtnPayType1" name="rbtnPayType"/></dd>
	<dd class="payname"><label for="rbtnPayType1">云网在线支付（手续费：无）</label></dd>
	<dd class="deta"><p>推荐一：云网在线支付 <font style="color: rgb(255, 0, 0);">免收手续费</font></p></dd>
</dl>
<dl class="payitem">
	<dd class="radio"><input type="radio" checked="checked" value="2" id="rbtnPayType2" name="rbtnPayType"/></dd>
	<dd class="payname"><label for="rbtnPayType2">支付宝（手续费：无）</label></dd>
	<dd class="deta"><p>推荐二：支付宝在线支付 <font style="color: rgb(255, 0, 0);">免收手续费</font></p></dd>
</dl>
<div class="clear"></div>
</div>

<div class="title_1">您的商品信息</div>
<table class="t1">
 
		<tr>
			<th>商品类别</th>
			<th>商品名称</th>
			<th>属性</th>
			<th>配件</th>
			<th>价格</th>
			<th>数量</th>
			<th>小计</th>
		</tr>
<c:forEach var="mobile" items="${orderList}" varStatus="status">  
		<tr>
			<td class="g">
				<c:if test="${goodstype == 0 }">手机</c:if>
			  	<c:if test="${goodstype == 1 }">配件</c:if>
			</td>
			<td class="g">${mobile.name }</td>
			<td class="g"><c:if test="${ mobile.colorName != null }">${ mobile.colorName }</c:if></td>
			<td class="g">${mobile.standard}</td>
			<td class="g money">￥${mobile.price }</td>
			<td class="g">${ mobile.orderNumber }</td>
			<td class="g money">${mobile.price * mobile.orderNumber }</td>
			<c:set var="total" value="${total+ (mobile.price * mobile.orderNumber)}"/>

		</tr>
</c:forEach>
 
</table>
<div class="title_1">订单金额</div>
<table class="t1">
	<tbody>
		<tr>
			<th>商品总额</th>
			<th>附加总额</th>
			<th>支付费率</th>
			<th>配送费率</th>
			<th>积分兑换</th>
			<th>订单总额</th>
		</tr>
		<tr>
			<td class="g"><span class="r" id="totalMoney">￥${total }</span></td>
			<td class="g"><span class="r">￥0.00</span></td>
			<td class="g"><span class="r">￥0.00</span></td>
			<td class="g"><span class="r" id="postMoney">￥40.00</span></td>
			<td class="g"><span class="blue">￥0.00</span></td>
			<td class="g money" id="allMoeny">￥${(total +40)}</td>
		</tr>
	</tbody>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td>&nbsp;</td>
		<td width="100"><a href="mobileCenter.action"><img src="images/o2_img9.png"  alt="继续购物" 	width="93" height="23" /></a></td>
		<td width="100"><a href="myshoppingcar.action"><img src="images/o2_img10.png" alt="编辑购物车"	width="93" height="23" /></a></td>
		<td width="150">
				<a href="#"><img src="images/o2_img11.png" onclick="submitOrder();return false"	width="136" height="44" /></a>
				<input type="hidden" name="telnumber" id="telnumber"/>
				<input type="hidden" name="orderHiddenSession" value="<% java.util.Date date = new java.util.Date();out.println(date.getTime()); session.setAttribute("orderSession",date.getTime());%>"/>
		</td>
	</tr>
</table>

<div class="clear"></div>
</div>
</form>
</div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
   <%@ include file="bottom.jsp" %>
</body>
</html>
